﻿
// 鼠标悬停提示
// 2013.4.5 xialei
// 主背景色（大区域）
// 通常使用明快的颜色（浅黄色等...）
	if (typeof fcolor == 'undefined') { var fcolor = "#ffffff";}
	
// Border的颜色和标题栏的颜色；
// 通常的颜色深（褐色，黑色等。）
	if (typeof backcolor == 'undefined') { var backcolor = "#CDCDCD";}
	
// 文字的颜色
// 通常是比较深的颜色；
	if (typeof textcolor == 'undefined') { var textcolor = "#999900";}
	
// 标题的颜色
// 通常是明快的颜色；
	if (typeof capcolor == 'undefined') { var capcolor = "#FFFFFF";}
	
// "Close"的颜色
// 通常是明快的颜色；
	if (typeof closecolor == 'undefined') { var closecolor = "#9999FF";}
	
// 弹出的窗口的宽度；
// 100-300 pixels 合适
	if (typeof mdWidth == 'undefined') { var mdWidth = 200;}
	
// 弹出的窗口的高度；
	if (typeof mdHeight == 'undefined') { var mdHeight = 100;}

// 边缘的宽度，象素。
// 1-3 pixels 合适
	if (typeof border == 'undefined') { var border = "1";}



// 以下是页面中使用的公共函数；
function DisplayToolInfoText(e,idArr,idapproved)
{

    var txtArr =[],obj,approvedName,stringInfo;
    for(var i=0;i<idArr.length;i++)
    {
        obj = document.getElementById(idArr[i]);
        
        txtArr[i] = (obj==null) ? "":obj.innerHTML;
    } 
    stringInfo = txtArr.join("<rn>");
    if(typeof idapproved != 'undefined'&&idapproved != '0')
    {
        approvedName = document.getElementById(idapproved);  
        var approvedNameStr = (approvedName==null) ? "":approvedName.innerHTML;
		
         approvedNameStr= (approvedNameStr.indexOf("0") != -1) ? "已无人需要处理":approvedNameStr;
        stringInfo += "<br>\r\n<div style='color:"+textcolor+";border:1px;float:left;font-weight:bold'>当前处理人："+approvedNameStr+"</div>"
    }
    wsug(e,stringInfo);
}

//展示数据摘要信息数据，该脚本核心来自网络，有部分修改（源码爱好者2013.4.5 http://www.codefans.net/down/13829.shtml）
function wsug(e, str){ 
 var oThis = arguments.callee;
 if(!str) {
  oThis.sug.style.visibility = 'hidden';
  document.onmousemove = null;
  return;
 }  
 if(!oThis.sug){
  var div = document.createElement('div'), css = 'top:0; left:0; position:absolute; z-index:100; visibility:hidden';
   div.style.cssText = css;
   div.setAttribute('style',css);
  var sug = document.createElement('div'), css= 'font:normal 12px/16px "宋体"; white-space:nowrap; color:#666; padding:3px; position:absolute; left:0; top:0; z-index:10; background:#f9fdfd; border:1px solid #0aa';
   sug.style.cssText = css;
   sug.setAttribute('style',css);
  var dr = document.createElement('div'), css = 'position:absolute; top:3px; left:3px; background:#333; filter:alpha(opacity=50); opacity:0.5; z-index:9';
   dr.style.cssText = css;
   dr.setAttribute('style',css);
  var ifr = document.createElement('iframe'), css='position:absolute; left:0; top:0; z-index:8; filter:alpha(opacity=0); opacity:0';
   ifr.style.cssText = css;
   ifr.setAttribute('style',css);
  div.appendChild(ifr);
  div.appendChild(dr);
  div.appendChild(sug);
  div.sug = sug;
  document.body.appendChild(div);
  oThis.sug = div;
  oThis.dr = dr;
  oThis.ifr = ifr;
  div = dr = ifr = sug = null;
 }
 var e = e || window.event, obj = oThis.sug, dr = oThis.dr, ifr = oThis.ifr;
 
 //修改摘要格式
 str = "<TABLE WIDTH="+mdWidth+" BORDER=0 CELLPADDING="+border+" CELLSPACING=0 BGCOLOR=\""+backcolor
	+"\"><TR><TD><TABLE WIDTH=100% BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR=\""+fcolor
	+"\"><TR><TD style=\"text-align:left;\"><FONT FACE=\"宋体\" COLOR=\""+textcolor+"\">"+str.replace(/<rn>/gi,"<br>\r\n")+"</FONT></TD></TR></TABLE></TD></TR></TABLE>";
	
 obj.sug.innerHTML = str;
 var w = obj.sug.offsetWidth, h = obj.sug.offsetHeight, dw = document.documentElement.clientWidth||document.body.clientWidth; dh = document.documentElement.clientHeight || document.body.clientHeight;
 var st = document.documentElement.scrollTop || document.body.scrollTop, sl = document.documentElement.scrollLeft || document.body.scrollLeft;
 var left = e.clientX +sl +17 + w < dw + sl && e.clientX + sl + 15 || e.clientX +sl-8 - w, top = e.clientY + st + 17;
 obj.style.left = left+ 10 + 'px';
 obj.style.top = top + 10 + 'px';
 dr.style.width = w + 'px';
 dr.style.height = h + 'px';
 ifr.style.width = w + 3 + 'px';
 ifr.style.height = h + 3 + 'px';
 obj.style.visibility = 'visible';
 document.onmousemove = function(e){
  var e = e || window.event, st = document.documentElement.scrollTop || document.body.scrollTop, sl = document.documentElement.scrollLeft || document.body.scrollLeft;
  var left = e.clientX +sl +17 + w < dw + sl && e.clientX + sl + 15 || e.clientX +sl-8 - w, top = e.clientY + st +17 + h < dh + st && e.clientY + st + 17 || e.clientY + st - 5 - h;
  obj.style.left = left + 'px';
  obj.style.top = top + 'px';
 }
}
